package com.example.kotlin

import android.annotation.SuppressLint
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Column
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.tooling.preview.Preview
import com.example.kotlin.jetpack_compose_by_tutorials.*
import com.example.kotlin.theme.MyApplicationTheme

class MainActivity : ComponentActivity() {
    @SuppressLint("MissingPermission")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val textValue = mutableStateOf("")
        setContent {
            MyApplicationTheme {
                // A surface container using the 'background' color from the theme
                Column {
                    MyTextFiled(textValue = textValue)
                    Text(text = textValue.value)
                }
            }
        }

    }
}


@Preview(showBackground = true)
@Composable
fun DefaultPreview() {
    MyApplicationTheme {
//        基础组件与定位
//        MyButton()
//        MyText()
//        MyTextFiled()
//        MyRadioButtonGroup()
//        MyFloatActionButton()
//        ProgressIndicatorScreen()
//        MyAlertDialog()
//        MyRow()
//        MyColumn()
//        MyBox()
//        MySurface(Modifier)
//        MyScaffold()

//       可滚动和延迟组合的容器
//        BookImageColumn()
//        BookImageLazyColumn()

//       约束布局
        ConstraintLayoutDemo()
    }
}